package com.qf.controller;

import com.qf.dto.PageSearchDTO;
import com.qf.entity.MallGoodsTemplate;
import com.qf.service.IGoodsTemplateService;
import com.qf.vo.PageResult;
import com.qf.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>title: com.qf.controller</p>
 * <p>Company: wendao</p>
 * author zhuximing
 * date 2021/9/17
 * description:
 */
@RestController
@RequestMapping("template")
@CrossOrigin
public class GoodsTemplateController {

    @Autowired
    private IGoodsTemplateService goodsTemplateService;


    @RequestMapping("page")
    public PageResult<MallGoodsTemplate> page(@RequestBody PageSearchDTO<MallGoodsTemplate> dto){

        return goodsTemplateService.selectByPage(dto);
    }
    @RequestMapping("saveTmp")
    public Result saveTmp(@RequestBody MallGoodsTemplate mallGoodsTemplate){

        return goodsTemplateService.save(mallGoodsTemplate);
    }
    @RequestMapping("editTmp")
    public Result editTmp(@RequestBody MallGoodsTemplate mallGoodsTemplate){

        return goodsTemplateService.editTmp(mallGoodsTemplate);
    }
    @RequestMapping("delTmp")
    public Result delTmp(@RequestBody MallGoodsTemplate mallGoodsTemplate){

        return goodsTemplateService.delTmp(mallGoodsTemplate);
    }

}